
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<HTML>

<HEAD>
   <TITLE>badkpv_c</TITLE>
</HEAD>

<BODY style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<A name="TOP"></A>

<table style="text-align: left; margin-left: auto; margin-right: auto; width: 800px;"
 border="0" cellpadding="5" cellspacing="2">
  <tbody>
    <tr>
      <td style="background-color: rgb(153, 153, 153); vertical-align: middle; text-align: center;">
      <div align="right"> 
      <small><small><a href="index.html">Index Page</a></small></small>
      </div>
      <b>badkpv_c</b> </td>
    </tr>

    <tr>
      <td style="vertical-align: top;">

<small><div align="center">
<A HREF="index.html#A">A</A>&nbsp;
<A HREF="index.html#B">B</A>&nbsp;
<A HREF="index.html#C">C</A>&nbsp;
<A HREF="index.html#D">D</A>&nbsp;
<A HREF="index.html#E">E</A>&nbsp;
<A HREF="index.html#F">F</A>&nbsp;
<A HREF="index.html#G">G</A>&nbsp;
<A HREF="index.html#H">H</A>&nbsp;
<A HREF="index.html#I">I</A>&nbsp;
<A HREF="index.html#J">J</A>&nbsp;
<A HREF="index.html#K">K</A>&nbsp;
<A HREF="index.html#L">L</A>&nbsp;
<A HREF="index.html#M">M</A>&nbsp;
<A HREF="index.html#N">N</A>&nbsp;
<A HREF="index.html#O">O</A>&nbsp;
<A HREF="index.html#P">P</A>&nbsp;
<A HREF="index.html#Q">Q</A>&nbsp;
<A HREF="index.html#R">R</A>&nbsp;
<A HREF="index.html#S">S</A>&nbsp;
<A HREF="index.html#T">T</A>&nbsp;
<A HREF="index.html#U">U</A>&nbsp;
<A HREF="index.html#V">V</A>&nbsp;
<A HREF="index.html#W">W</A>&nbsp;
<A HREF="index.html#X">X</A>&nbsp;
</div></small>
       <br>
       <table style="text-align: left; width: 60%; margin-left: auto; margin-right: auto;"
       border="0" cellspacing="2" cellpadding="2">
        <tbody>
          <tr>
            <td style="width: 50%; text-align: center;">
            <small>
              <a href="#Procedure">Procedure<br></a>
              <a href="#Abstract">Abstract<br></a>
              <a href="#Required_Reading">Required_Reading<br></a>
              <a href="#Keywords">Keywords<br></a>
              <a href="#Brief_I/O">Brief_I/O<br></a>
              <a href="#Detailed_Input">Detailed_Input<br></a>

              </small>
              </td>
              <td style="vertical-align: top; width: 50%; text-align: center;">
              <small>               <a href="#Detailed_Output">Detailed_Output<br></a>
              <a href="#Parameters">Parameters<br></a>
              <a href="#Exceptions">Exceptions<br></a>
              <a href="#Files">Files<br></a>
              <a href="#Particulars">Particulars<br></a>
              <a href="#Examples">Examples<br></a>

              </small>
              </td>
              <td style="vertical-align: top; width: 50%; text-align: center;">
              <small>               <a href="#Restrictions">Restrictions<br></a>
              <a href="#Literature_References">Literature_References<br></a>
              <a href="#Author_and_Institution">Author_and_Institution<br></a>
              <a href="#Version">Version<br></a>
              <a href="#Index_Entries">Index_Entries<br></a>
             </small>
            </td>
          </tr>
        </tbody>
</table>

<h4><a name="Procedure">Procedure</a></h4>
<PRE>
   SpiceBoolean badkpv_c ( ConstSpiceChar    *caller,
                           ConstSpiceChar    *name,
                           ConstSpiceChar    *comp,
                           SpiceInt           size,
                           SpiceInt           divby,
                           SpiceChar          type   )

</PRE>
<h4><a name="Abstract">Abstract</a></h4>
<PRE>
 
   Determine if a kernel pool variable is present and if so 
   that it has the correct size and type. 
 </PRE>
<h4><a name="Required_Reading">Required_Reading</a></h4>
<PRE>
 
    None. 
 </PRE>
<h4><a name="Keywords">Keywords</a></h4>
<PRE>
 
    ERROR 
 

</PRE>
<h4><a name="Brief_I/O">Brief_I/O</a></h4>
<PRE>
 
   VARIABLE  I/O  DESCRIPTION 
   --------  ---  -------------------------------------------------- 
   caller     I   Name of the routine calling this routine. 
   name       I   Name of a kernel pool variable 
   comp       I   Comparison operator. 
   size       I   Expected size of the kernel pool variable 
   divby      I   A divisor of the size of the kernel pool variable. 
   type       I   Expected type of the kernel pool variable 
 
   The function returns SPICEFALSE if the kernel pool variable is OK.
 </PRE>
<h4><a name="Detailed_Input">Detailed_Input</a></h4>
<PRE>
 
   caller     is the name of the routine calling this routine 
              to check correctness of kernel pool variables. 
 
   name       is the name of a kernel pool variable that the 
              calling program expects to be present in the 
              kernel pool. 
 
   comp       is the comparison operator to use when comparing 
              the number of components of the kernel pool variable 
              specified by name with the integer size.  If dim is 
              is the actual size of the kernel pool variable then 
              <b>badkpv_c</b> will check that the sentence 
 
                  dim comp size 
 
              is a true statement.  If it is not a true statement 
              an error will be signaled. 
 
              Allowed values for comp and their meanings are: 
 
                 &quot;=&quot;      dim == size 
                 &quot;&lt;&quot;      dim &lt;  size 
                 &quot;&gt;&quot;      dim &gt;  size 
                 &quot;=&gt;&quot;     dim &gt;= size 
                 &quot;&lt;=&quot;     dim &lt;= size 
 
 
   size       is an integer to compare with the actual 
              number of components of the kernel pool variable 
              specified by name. 
 
   divby      is an integer that is one of the factors of the 
              actual dimension of the specified kernel pool variable. 
              In other words, it is expected that divby evenly 
              divides the actual dimension of name. In those 
              cases in which the factors of the dimension of name 
              are not important, set divby to 1 in the calling 
              program. 
 
   type       is the expected type of the kernel pool variable. 
              Recognized values are 
 
                'C' for character type 
                'N' for numeric type (integer and double precision) 
 
              The case of type is insignificant.  If the value 
              of TYPE is not one of the 2 values given above 
              no check for the type of the variable will be 
              performed. 
 
 </PRE>
<h4><a name="Detailed_Output">Detailed_Output</a></h4>
<PRE>
 
   The function returns the value SPICEFALSE if the kernel pool variable 
   has the expected properties.  Otherwise the routine signals 
   an error and returns the value SPICETRUE.
 </PRE>
<h4><a name="Parameters">Parameters</a></h4>
<PRE>
 
   None. 
 </PRE>
<h4><a name="Exceptions">Exceptions</a></h4>
<PRE>
 
   1) If the kernel pool variable specified by name is not 
      present in the kernel pool, the error 
      SPICE(VARIABLENOTFOUND) will be signaled and the 
      routine will return the value SPICETRUE.
 
   2) If the comparison operator specified by comp is unrecognized 
      the error SPICE(UNKNOWNCOMPARE) will be signaled and the 
      routine will return the value SPICETRUE.
 
   3) If the comparison of the actual size of the kernel pool 
      variable with size is not satisfied, the error 
      SPICE(BADVARIABLESIZE) will be signaled and the 
      routine will return the value SPICETRUE.
 
   4) If the variable does not have the expected type, the error 
      SPICE(BADVARIABLETYPE) will be signaled and the routine 
      will return the value SPICETRUE.
 
   5) If any input string pointers are null, the error
      SPICE(NULLPOINTER) will be signaled.
 
   6) If any input strings have length zero, the error
      SPICE(EMPTYSTRING) will be signaled.
      </PRE>
<h4><a name="Files">Files</a></h4>
<PRE>
 
   None. 
 </PRE>
<h4><a name="Particulars">Particulars</a></h4>
<PRE>
 
   This routine takes care of routine checking that often needs 
   to be done by programs and routines that rely upon kernel 
   pool variables being present and having the correct attributes. 
 
   It checks for the presence of the kernel pool variable and 
   examines the type and dimension of the variable to make sure 
   they conform to the requirements of the calling routine. 
 </PRE>
<h4><a name="Examples">Examples</a></h4>
<PRE>
 
   Suppose that you need to fetch a number of variables 
   from the kernel pool and want to check that the requested 
   items are in fact available prior to performing further 
   computations. The following shows how you might use 
   this routine to handle the details of checking of 
   the various items. 
 
         caller  == &quot;MYROUTINE&quot;
 
      We need some data for body 399 and we expect there to 
      be an even number of items available.  Moreover we 
      expect these items to be numeric. 
 
         name  == &quot;BODY_399_DATA&quot;
         comp  == &quot;&gt;&quot;
         size  ==  1
         divby ==  2
         type  == 'N'
 
      In addition we need the units associated with this data. 
      We expect the units to be character and that the number 
      of components is 1. 
 
         name  == &quot;BODY_399_DATAUNIT&quot;; 
         comp  == &quot;=&quot; 
         size  == 1 
         divby == 1
         type  == 'C'
         
 
      if (   <b>badkpv_c</b>( caller, &quot;BODY_399_DATA&quot;,      &quot;&gt;&quot;, 1, 2, 'N' ) 
          || <b>badkpv_c</b>( caller, &quot;BODY_399_DATAUNITS&quot;, &quot;=&quot;, 1, 1, 'C' ) ) 
      {
         <a href="chkout_c.html">chkout_c</a> ( &quot;MYROUTINE&quot; );
         return;
      } 
 
 </PRE>
<h4><a name="Restrictions">Restrictions</a></h4>
<PRE>
 
   None. 
 </PRE>
<h4><a name="Literature_References">Literature_References</a></h4>
<PRE>
 
   None. 
 </PRE>
<h4><a name="Author_and_Institution">Author_and_Institution</a></h4>
<PRE>
 
   W.L. Taber      (JPL) 
   N.J. Bachman    (JPL)
   </PRE>
<h4><a name="Version">Version</a></h4>
<PRE>
 
   -CSPICE Version 1.0.0, 07-JUL-2000 (WLT) (NJB)
</PRE>
<h4><a name="Index_Entries">Index_Entries</a></h4>
<PRE>
 
   Check the properties of a kernel pool variable 
 </PRE>
<h4>Link to routine badkpv_c source file <a href='../../../src/cspice/badkpv_c.c'>badkpv_c.c</a> </h4>

      </td>
    </tr>
  </tbody>
</table>

   <pre>Wed Jun  9 13:05:19 2010</pre>

</body>
</html>

